//Event Class
#include "Event.h"

//default constructor
Event::Event() {
}

//default destructor
Event::~Event() {

}

//OnEvent-
void Event::OnEvent(SDL_Event* Event) {
	switch(Event->type) {
		case SDL_ACTIVEEVENT: {
			switch(Event->active.state) {
				case SDL_APPACTIVE:	{
					if ( Event->active.gain )
                        OnRestore();
					else
                        OnMinimize();
                    break;
				}
			}
			break;
		}

		case SDL_KEYDOWN: {
			OnKeyDown(Event->key.keysym.sym,Event->key.keysym.mod,Event->key.keysym.unicode);
			break;
		}

		case SDL_KEYUP: {
			OnKeyUp(Event->key.keysym.sym,Event->key.keysym.mod,Event->key.keysym.unicode);
			break;
		}

		case SDL_QUIT: {
			OnExit();
			break;
		}

		case SDL_SYSWMEVENT: {
			//Ignore
			break;
		}

		case SDL_VIDEORESIZE: {
			OnResize(Event->resize.w,Event->resize.h);
			break;
		}


		default: {
			OnUser(Event->user.type,Event->user.code,Event->user.data1,Event->user.data2);
			break;
		}
	}
}

//OnKeyDown
void Event::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode) {
	//Pure virtual
}

//OnKeyUp
void Event::OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode) {
	//Pure virtual
}


//OnMinimize
void Event::OnMinimize() {
	//Pure virtual
}

//OnRestore
void Event::OnRestore() {
	//Pure virtual
}

//OnResize
void Event::OnResize(int w,int h) {
	//Pure virtual
}

//OnExit
void Event::OnExit() {
	//Pure virtual
}

//OnUser
void Event::OnUser(Uint8 type, int code, void* data1, void* data2) {
	//Pure virtual
}
